# 同一方法在不同的场景下有不同的作用效果的一个技能
print(3 + 5)  # 8
print("3" + "5")  # 35

print(3 * 5)  # 15
print(3 * "FishC")  # FishCFishCFishC

print(len("FishC"))
print(len(["FishC", "Python", "me"]))


class Shape:
    def __init__(self, name):
        self.name = name

    def area(self):
        # 父类定义标准，不用实现
        pass


class Square(Shape):
    def __init__(self, length):
        super().__init__("正方形")
        self.length = length

    def area(self):
        return self.length * self.length


class Circle(Shape):
    def __init__(self, radius):
        super().__init__("圆形")
        self.radius = radius

    def area(self):
        return 3.14 * self.radius * self.radius


class Triangle(Shape):
    def __init__(self, base, height):
        super().__init__("三角形")
        self.base = base
        self.height = height

    def area(self):
        return (self.base * self.height) / 2


s = Square(5)
c = Circle(6)
t = Triangle(3, 4)


print(s.name)
print(c.name)
print(t.name)

print(s.area())
print(c.area())
print(t.area())